/**
 * 
 */
package javapop.framework.generic;

import java.util.List;

import javapop.framework.generic.tool.GrammarVisitor;

/**
 * @author hakim
 *
 */
public class GKeywords implements GrammarTree {

	private List<GKeyword> keywords; 
	/**
	 * 
	 */
	public GKeywords(List<GKeyword> keywords) {
		this.keywords = keywords;
	}
	
	public List<GKeyword> getKeywords() {
		return keywords;
	}

	@Override
	public <T,R,E extends Exception> T visit(GrammarVisitor<T,R, E> g) throws E {
		return g.visit(this);
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("@keywords(");
		for(int i = 0; i < keywords.size();i++) {
			sb.append(keywords.get(i));
			if(i == keywords.size() - 1)
				sb.append(");");
			else
				sb.append(",");
		}
		return sb.toString();
	}
}
